//
//  TrackDetailTableViewCell.m
//  瓜子电台
//
//  Created by lanou on 16/8/9.
//  Copyright © 2016年 YueZhang. All rights reserved.
//

#import "TrackDetailTableViewCell.h"

@implementation TrackDetailTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setDataWithModel:(XiaoBianMoreModel *)model
{
    [self.pic sd_setImageWithURL:[NSURL URLWithString:model.coverMiddle] placeholderImage:[UIImage imageNamed:@"picPlaceHolder"]];
    [[self.pic layer] setShadowOffset:CGSizeMake(5, 5)];
    [[self.pic layer] setShadowRadius:2];
    [[self.pic layer] setShadowOpacity:0.5];
    [[self.pic layer] setShadowColor:[UIColor blackColor].CGColor];
    self.title.text = model.title;
    self.author.text = [NSString stringWithFormat:@"主播：%@", model.nickname];
    float a = (CGFloat)model.playsCounts / 10000;
    char buf[10];
    sprintf(buf, "%.1f", a);
    sscanf(buf, "%f", &a);
    NSString *str = [NSString stringWithFormat:@"%s万", buf];
    self.playTime.text = [NSString stringWithFormat:@"播放数：%@", str];
    [self.dingYueBtn setBackgroundColor:[UIColor greenColor]];
    [self.dpo setTintColor:[UIColor greenColor]];
    self.dingYueBtn.layer.cornerRadius = 5.f;
    self.dpo.layer.cornerRadius = 5.f;
    self.dpo.layer.borderColor = [UIColor greenColor].CGColor;
    self.dpo.layer.borderWidth = 1.5f;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
